package DB.dao;

import DB.dto.*;
import DB.exceptions.*;

public interface PersonDao
{
	/** 
	 * Inserts a new row in the PERSON table.
	 */
	public int insert(PersonDto dto) throws PersonDaoException;

	/** 
	 * Updates a single row in the PERSON table.
	 */
	public void update(int pk, PersonDto dto) throws PersonDaoException;

	/** 
	 * Deletes a single row in the PERSON table.
	 */
	public void delete(int pk) throws PersonDaoException;

	/** 
	 * Returns the rows from the PERSON table that matches the specified primary-key value.
	 */
	public PersonDto findByPrimaryKey(int pk) throws PersonDaoException;
	/** 
	 * Returns all rows from the PERSON table that match the criteria ''.
	 */
	public PersonDto[] findAll() throws PersonDaoException;

	/** 
	 * Returns all rows from the PERSON table that match the criteria 'NAME = :name'.
	 */
	public PersonDto[] findWhereNameEquals(String name) throws PersonDaoException;

	/** 
	 * Returns all rows from the PERSON table that match the criteria 'LOGIN = :login'.
	 */
	public PersonDto[] findWhereLoginEquals(String login) throws PersonDaoException;

	/** 
	 * Returns all rows from the PERSON table that match the criteria 'PASSWORD = :password'.
	 */
	public PersonDto[] findWherePasswordEquals(String password) throws PersonDaoException;

	/** 
	 * Returns all rows from the PERSON table that match the criteria 'ID_PERSON = :idPerson'.
	 */
	public PersonDto[] findWhereIdPersonEquals(int idPerson) throws PersonDaoException;

	/** 
	 * Sets the value of maxRows
	 */
	public void setMaxRows(int maxRows);

	/** 
	 * Gets the value of maxRows
	 */
	public int getMaxRows();

	/** 
	 * Returns all rows from the PERSON table that match the specified arbitrary SQL statement
	 */
	public PersonDto[] findByDynamicSelect(String sql, Object[] sqlParams) throws PersonDaoException;

	/** 
	 * Returns all rows from the PERSON table that match the specified arbitrary SQL statement
	 */
	public PersonDto[] findByDynamicWhere(String sql, Object[] sqlParams) throws PersonDaoException;

}
